﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<link rel="Stylesheet" type="text/css" media="screen" href="Screen.css" />
  <title>StpCallback_OnTopologyChange</title>
</head>
<body>
	<h3>StpCallback_OnTopologyChange</h3>
	<hr />
<pre>
void StpCallback_OnTopologyChange
(
    const struct STP_BRIDGE* bridge,
    unsigned int treeIndex,
    unsigned int timestamp
);
</pre>
	<h4>
		Summary</h4>
	<p>
		Application-defined function that is called by the STP library when it detects a change in the network topology on the local bridge.</p>
	<p>
		This callback allows the application to implement the following:</p>
	<ul>
		<li>from 802.1Q-2018: <strong>12.8.1.2.3, c) and d)</strong> and <strong>12.8.1.1.3, b) and c)</strong>;</li>
		<li>from IEEE8021-SPANNING-TREE-MIB: <strong>ieee8021SpanningTreeTimeSinceTopologyChange</strong> and <strong>ieee8021SpanningTreeTopChanges</strong>.</li>
	</ul>
	<h4>
		Parameters</h4>
	<dl>
		<dt>bridge</dt>
		<dd>The application receives in this parameter a pointer to an STP_BRIDGE object.</dd>
		<dt>treeIndex</dt>
		<dd>The application receives in this parameter the zero-based index of the spanning tree on which the topology change ocurred. For STP or RSTP, this is always zero. For
			MSTP, this is zero for CIST, or 1..64 for a MSTI.</dd>
		<dt>timestamp</dt>
		<dd>The application receives in this parameter the timestamp that it passed to the function
			that called this callback (STP_OnBpduReceived, STP_OnPortEnabled etc.)
			Useful for debugging and troubleshooting.</dd>
	</dl>
	<h4>
		Remarks</h4>
	<p>
			The library calls this callback only as long as the bridge is running at least RSTP (see <a href="STP_CreateBridge.html">STP_CreateBridge</a>, <a href="STP_SetStpVersion.html">STP_SetStpVersion</a>). The detection of topology changes in LegacySTP mode (as per 8.5.3.12 in 802.1D-1998) is not yet implemented.</p>
    <p>
			The STP library calls this callback when it detects a topology change
			<em>on the local bridge</em> (i.e., a non-edge port transitioning to/from the forwarding state while the bridge is not isolated).</p>

	<p>
		StpCallback_OnTopologyChange is a placeholder name used throughout this documentation. The
		application may name this callback differently.</p>

</body>
</html>
